package com.scx.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class DBConfig extends Properties {
	private static DBConfig instance;

	public static DBConfig getInstance() {
		if (null != instance) {
			return instance;
		} else {
			makeInstance();
			return instance;
		}
	}

	private static synchronized void makeInstance() {
		if (instance == null) {
			instance = new DBConfig();
		}
	}

	private DBConfig() {
		InputStream is = getClass().getResourceAsStream("/com/scx/run/jdbc.properties");
		try {
			load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
